package com.headingdata.demo;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {

        Movie[] movies = new Movie[4];
        movies[0] = new Movie(1,"水门桥",48,8.5,"罗拉","吴京","50.3万人想看");
        movies[1] = new Movie(2,"摔跤吧，爸爸！",40,8.0,"曼玉","天宇","30.4万人想看");
        movies[2] = new Movie(3,"夏洛特烦恼",35,8.9,"许可","李斯特","62.3万人想看");
        movies[3] = new Movie(4,"大风打更人",38,7.9,"魏征","刘昊然","45.3万人想看");
        MovieOperator operator = new MovieOperator(movies);

//        operator.printMovieList();
//
//        operator.printMovieInfoById(3);
        while (true) {
            System.out.println("==电影信息系统==");
            System.out.println("1.输入\"1\"查询电影列表信息。");
            System.out.println("2.输入\"2\"根据电影编号查询电影详细信息。");
            System.out.println("请您输入操作命令：");
            Scanner scan = new Scanner(System.in);
            int command = scan.nextInt();
            switch (command){
                case 1:
                    operator.printMovieList();break;
                case 2:
                    System.out.println("请输入电影编号：");
                    int id = scan.nextInt();
                    operator.printMovieInfoById(id);break;
                default:
                    System.out.println("您输入的命令有问题~~，请重新输入！");

            }
        }

    }
}
